package com.zxx.pattern.mediatorPattern.mediator1;

/**
 * 用户类
 * @author zxx on 2021/5/11
 */
public class User {
    private String name;

    public User(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void sendMessage(ChatRoom chatRoom, String message) {
        System.out.println(name + "发出消息：" + message);
        chatRoom.operateMessage(new Message(this, message));
    }
}
